package com.season.summer.bspgenerator.dao;

import com.season.summer.bspgenerator.entity.TableEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 代码生成器
 * Wangqy
 */
@Mapper
public interface GeneratorDao {

	List<TableEntity> list(@Param("tableName") String tableName);

	@Select("select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns where table_name = #{tableName} and table_schema = (select database())  and column_name != 'create_time' and column_name != 'update_time' order by ordinal_position")
	List<Map<String, String>> queryColumns(String tableName);
}

